set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

--CREATEd:02/08/2010
--Author: nnamthach@gmail.com
Create procedure [dbo].[procProducts_getTopSeller]
AS
BEGIN
SELECT top 5  COUNT(OrderProduct.ID) AS SLOrder, Products.Code, Products.ID, Products.NameVN, Products.Image, Products.NewPrice
FROM         Products INNER JOIN
                      OrderProduct ON Products.ID = OrderProduct.ProductID
GROUP BY Products.Code, Products.ID, Products.NameVN, Products.Image, Products.NewPrice
ORDER BY SLOrder DESC
END

